def mat2cell(mat,m,n):
    r, c = mat.shape
    stepr = int(r/m)
    stepc = int(c/n)


    # inital brt
    brt = []
    for midx in range(m):
        for nidx in range(n):
            img = mat[midx*stepr:(midx+1)*stepr,nidx*stepc:(nidx+1)*stepc]
            brt.append(img)
    return brt
